Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jenkins_exporter_errors{type=http_requests_total} + jenkins_http_requests_total metric mix up #28

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

fho
Copy link
Collaborator

@fho fho commented Dec 11, 2023

metrics: remove wrong jenkins_exporter_errors{type=http_requests_total} metric

The jenkins_http_requests_total and jenkins_exporter_errors metrics are mixed
up.
A metric called jenkins_exporter_errors with the label http_requests_total is
incremented for every http requests.
The name implied it only counts errors but this is not the case.
The documented metric called jenkins_http_requests_total is not recorded at all.

Remove jenkins_exporter_errors metrics with the http_requests_total label.
Remove mentions of the jenkins_http_requests_total metrics in the README.

If it turns out that there is a use case for the jenkins_http_requests_total
metric it can be added back.

-----------------------

http: do not use buffer when draining and discarding http body

Use io.Copy with io.Discard instead of io.ReadAll to drain the whole http body
when an error occurred.

This does not write the body unnecessary to a buffer in memory that will never
be used.

…l} metric

The jenkins_http_requests_total and jenkins_exporter_errors metrics are mixed
up.
A metric called jenkins_exporter_errors with the label http_requests_total is
incremented for every http requests.
The name implied it only counts errors but this is not the case.
The documented metric called jenkins_http_requests_total is not recorded at all.

Remove jenkins_exporter_errors metrics with the http_requests_total label.
Remove mentions of the jenkins_http_requests_total metrics in the README.

If it turns out that there is a use case for the jenkins_http_requests_total
metric it can be added back.
Use io.Copy with io.Discard instead of io.ReadAll to drain the whole http body
when an error occurred.

This does not write the body unnecessary to a buffer in memory that will never
be used.
@fho fho marked this pull request as ready for review December 11, 2023 11:55
@fho fho self-assigned this Dec 11, 2023
@fho fho merged commit 1805484 into main Dec 12, 2023
5 checks passed
@fho fho deleted the metrics_fix branch December 12, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants